/**
 * Copyright 2012 Tom Hombergs (tom.hombergs@gmail.com)
 *
 *   Licensed under the Apache License, Version 2.0 (the "License");
 *   you may not use this file except in compliance with the License.
 *   You may obtain a copy of the License at
 *        http://www.apache.org/licenses/LICENSE-2.0
 *
 *   Unless required by applicable law or agreed to in writing, software
 *   distributed under the License is distributed on an "AS IS" BASIS,
 *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *   See the License for the specific language governing permissions and
 *   limitations under the License.
 */
package com.googlecode.wicketcharts.highcharts.jackson;

import com.fasterxml.jackson.core.Version;
import com.fasterxml.jackson.databind.module.SimpleModule;
import com.googlecode.wicketcharts.highcharts.json.LowercaseEnum;
import com.googlecode.wicketcharts.highcharts.options.Center;
import com.googlecode.wicketcharts.highcharts.options.CssStyle;
import com.googlecode.wicketcharts.highcharts.options.DateTimeLabelFormat;
import com.googlecode.wicketcharts.highcharts.options.Function;
import com.googlecode.wicketcharts.highcharts.options.MinorTickInterval;
import com.googlecode.wicketcharts.highcharts.options.PixelOrPercent;
import com.googlecode.wicketcharts.highcharts.options.Symbol;
import com.googlecode.wicketcharts.highcharts.options.color.HexColor;
import com.googlecode.wicketcharts.highcharts.options.color.HighchartsColor;
import com.googlecode.wicketcharts.highcharts.options.color.NullColor;
import com.googlecode.wicketcharts.highcharts.options.color.RgbaColor;
import com.googlecode.wicketcharts.highcharts.options.color.SimpleColor;
import com.googlecode.wicketcharts.highcharts.options.series.Coordinate;

public class WicketChartsModule extends SimpleModule {

	@SuppressWarnings("unchecked")
	public WicketChartsModule() {
		super("wicket-charts", new Version(1, 1, 0, null, "com.googlecode.wicket-charts", "wicket-charts"));
		addSerializer(Center.class, new CenterSerializer());
		addSerializer(SimpleColor.class, new SimpleColorReferenceSerializer());
		addSerializer(HighchartsColor.class, new HighchartsColorReferenceSerializer());
		addSerializer(HexColor.class, new HexColorReferenceSerializer());
		addSerializer(LowercaseEnum.class, new LowercaseEnumSerializer());
		addSerializer(PixelOrPercent.class, new PixelOrPercentSerializer());
		addSerializer(Symbol.class, new SymbolSerializer());
		addSerializer(RgbaColor.class, new RgbaColorReferenceSerializer());
		addSerializer(NullColor.class, new NullColorReferenceSerializer());
		addSerializer(MinorTickInterval.class, new MinorTickIntervalSerializer());
		this.addSerializer(Function.class, new FunctionSerializer());
		this.addSerializer(CssStyle.class, new CssStyleSerializer());
		this.addSerializer(DateTimeLabelFormat.class, new DateTimeLabelFormatSerializer());
		this.addSerializer(Coordinate.class, new CoordinateSerializer());
	}

}
